Skip to content

[5.9] Add a conditional compilation flag to disable preconditions #1621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 29, 2023

  • Explanation: In some situations, like an IDE that runs SwiftSyntax in process, crashing is the worst possible outcome and it’s preferable to continue running, possibly accepting a misparse. These use cases can disable preconditions in SwiftSyntax using a conditional compilation flag.
  • Scope: All preconditions in SwiftSyntax
  • Risk: Low, this is a no-op unless the conditional compilation flag is passed
  • Testing: Made sure existing tests still pass
  • Issue: rdar://108681003
  • Reviewer: @bnbarham on Add a conditional compilation flag to disable preconditions #1620

In some situations, like an IDE that runs SwiftSyntax in process, crashing is the worst possible outcome and it’s preferrable to continue running, possibly accepting a misparse. These use cases can disable preconditions in SwiftSyntax using a conditional compilation flag

rdar://108666839
@ahoppen ahoppen requested review from DougGregor and bnbarham April 29, 2023 14:54
@ahoppen
Copy link
Member Author

ahoppen commented Apr 29, 2023

@swift-ci Please test

@ahoppen ahoppen changed the title Add a conditional compilation flag to disable preconditions [5.9] Add a conditional compilation flag to disable preconditions Apr 29, 2023
@ahoppen ahoppen merged commit 99103d1 into swiftlang:release/5.9 May 1, 2023
@ahoppen ahoppen deleted the ahoppen/5.9/disable-precondition branch May 1, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants